package com.zzyl.controller.customer;

import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.dto.UserLoginRequestDto;
import com.zzyl.service.MemberService;
import com.zzyl.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/customer/user")
@RestController
public class CustomerUserController extends BaseController {

    @Autowired
    private MemberService memberService;

    @PostMapping("login")
    public ResponseResult login(@RequestBody UserLoginRequestDto userLoginRequestDto){
        // 访问MemberService，实现登录
        LoginVo login = memberService.login(userLoginRequestDto);
        return success(login);
    }

}
